package service;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
@WebServlet("/systemLoginServlet")
public class SystemLoginServletwrong extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        resp.setContentType("text/html;charset=utf-8");
//        String name = req.getParameter("name");
//        String password = req.getParameter("password");
//        Imp_Sysmanage imp_sysmanage=new Imp_Sysmanage();
//        boolean login=imp_sysmanage.sysmanagerlogin(name,password);
//        if (!login) {
//            //登陆失败
//            req.setAttribute("login_fail","用户名或密码错误");
//            req.getRequestDispatcher("/system_login.jsp").forward(req,resp);
//        }
//        else {
//            //登录成功
//            HttpSession session=req.getSession();
//            session.setAttribute("name",name);
//            resp.sendRedirect(req.getContextPath()+"/systemNote.jsp");
//        }
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        this.doPost(req, resp);
    }
}
